﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;
using System.Data;
using Aspose.Cells;
using System.ComponentModel;

/// <summary>
/// Summary description for OutReport
/// </summary>
public class OutReport
{
    public OutReport()
    {
        General.SetLicenseForAspose();
    }

    public void OutReportToScreen(string path, DataTable[] objTable, string nameReportOut)
    {
        Aspose.Cells.WorkbookDesigner designer;
        try
        {
            designer = new WorkbookDesigner();
            designer.Open(path);
            designer.ClearDataSource();           
            foreach (DataTable item in objTable)
            {
                designer.SetDataSource(item);
            }
            designer.Process();

            //save workbook lai
            designer.Workbook.Save(General.DateTimeName() + nameReportOut, FileFormatType.Excel2003, SaveType.OpenInExcel, HttpContext.Current.Response);

        }
        catch
        {
           
        }
    }


}